﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AgentReservationSearch.aspx.cs" Inherits="CRM_Project.AgentReservations" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Agent Reservation Search</title>
    <style type="text/css">
        .style1
        {
            width: 106px;
        }
        .style2
        {
            width: 300px;
        }
        .style3
        {
            width: 106px;
            height: 23px;
        }
        .style4
        {
            width: 300px;
            height: 23px;
        }
        .style5
        {
            height: 23px;
        }
        .style6
        {
            width: 120px;
        }
        .style7
        {
            height: 23px;
            width: 120px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <h1>Search Reservations</h1>
        <a href="Default.aspx">Make New Reservation</a>
        <br />
        <table style="width:100%;">
            <tr>
                <td class="style6" align="right">
                    <asp:Label ID="pickupLot_label" runat="server" Text="Pickup Lot :"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="pickupLot_textbox" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style1" align="right">
                    <asp:Label ID="customer_label" runat="server" Text="Customer :"></asp:Label>
                </td>
                <td class="style2">
                    <asp:TextBox ID="customer_textbox" runat="server"></asp:TextBox>
                </td>
                <td class="style6" align="right">
                    <asp:Label ID="returnLot_label" runat="server" Text="Return Lot :"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="returnLot_textbox" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style3" align="right">
                    <asp:Label ID="creditcard_label" runat="server" Text="Credit Card # :"></asp:Label>
                </td>
                <td class="style4">
                    <asp:TextBox ID="creditcard_textbox" runat="server"></asp:TextBox>
                </td>
                <td class="style7" align="right">
                    <asp:Label ID="reservationMethod_label" runat="server" 
                        Text="Reservation_Method"></asp:Label>
                </td>
                <td class="style5">
                    <asp:TextBox ID="reservationMethod_textbox" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="style1" align="right">
                    <asp:Label ID="pickupdate_label" runat="server" Text="Pickup Date :"></asp:Label>
                </td>
                <td class="style2">
                    <asp:Calendar ID="pickupdate_calendar" runat="server"></asp:Calendar>
                </td>
                <td class="style6" align="right">
                    <asp:Label ID="returndate_label" runat="server" Text="Return Date :"></asp:Label>
                </td>
                <td>
                    <asp:Calendar ID="returndate_calendar" runat="server"></asp:Calendar>
                </td>
            </tr>
            <tr>
                <td class="style1">
                    <asp:Button ID="search_button" runat="server" Text="Search" 
                        onclick="search_button_Click" />
                </td>
                <td class="style2">
                    &nbsp;</td>
                <td class="style6">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
        <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
            ContextTypeName="CRM_Project.crmengine" 
            Select="new (CustomerName, StartTime, EndTime, ID, StartLot.Name as StartLotName, EndLot.Name as EndLotName, Cost, CreditCardNumber, Method, IsEmployee)" 
            TableName="Reservations">
        </asp:LinqDataSource>
        <br />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataSourceID="LinqDataSource1">
            <Columns>
                <asp:HyperLinkField DataNavigateUrlFields="ID" 
                    DataNavigateUrlFormatString="~/AgentReservations.aspx?Cancel={0}" 
                    Text="Cancel" />
                <asp:BoundField HeaderText="ID" DataField="ID" />
                <asp:HyperLinkField DataNavigateUrlFields="ID" 
                                    DataNavigateUrlFormatString="~/AgentEditReservation.aspx?ReservationID={0}" 
                                    Text="Edit" />
                <asp:BoundField HeaderText="Customer" DataField="CustomerName" />
                <asp:BoundField HeaderText="Pickup Time" DataField="StartTime" />
                <asp:BoundField HeaderText="Return Time" DataField="EndTime" />
                <asp:BoundField HeaderText="Pickup Lot" DataField="StartLotName" />
                <asp:BoundField HeaderText="Return Lot" DataField="EndLotName" />
                <asp:BoundField HeaderText="Cost" DataField="Cost" />
                <asp:BoundField HeaderText="Reservation Method" DataField="Method" />
                <asp:BoundField HeaderText="CC Number" DataField="CreditCardNumber" />
                <asp:BoundField HeaderText="Employee?" DataField="IsEmployee" />
            </Columns>
        </asp:GridView>
        
        </div>
    </form>
</body>
</html>
